﻿Public Class Xbox360ControllerFactory
    Implements IControllerFactory

    Private m_index As Microsoft.Xna.Framework.PlayerIndex

    Public Sub New(ByVal controllerIndex As Microsoft.Xna.Framework.PlayerIndex)
        m_index = controllerIndex
    End Sub

    Public Function CreateController() As IController Implements IControllerFactory.CreateController
        Return New Xbox360Controller(m_index)
    End Function

    Public ReadOnly Property Description() As String Implements IControllerFactory.Description
        Get
            Select Case m_index
                Case Microsoft.Xna.Framework.PlayerIndex.One
                    Return "Xbox 360 Controller - One"

                Case Microsoft.Xna.Framework.PlayerIndex.Two
                    Return "Xbox 360 Controller - Two"

                Case Microsoft.Xna.Framework.PlayerIndex.Three
                    Return "Xbox 360 Controller - Three"

                Case Microsoft.Xna.Framework.PlayerIndex.Four
                    Return "Xbox 360 Controller - Four"
            End Select
        End Get
    End Property
End Class
